//
//  QuoteDetailControl.m
//  FreeTime
//
//  Created by 王江华 on 16/9/2.
//  Copyright © 2016年 SRDZ.com. All rights reserved.
//

#import "QuoteDetailControl.h"
#import "Header.h"
@interface QuoteDetailControl ()


@property(nonatomic,strong)UIView *quoteView;

@property(nonatomic,strong)UIView *topView,*middleView;


@property(nonatomic,strong)UILabel *propertyLabel, *contentLabel, *statusLabel;

@property(nonatomic,strong)UIView *lineViewOne, *lineViewTwo;

@property(nonatomic,strong)UIImageView *headImg, *sexImg;

@property(nonatomic,strong)UILabel *nameLabel, *priceLabel;

@end

@implementation QuoteDetailControl

- (void)viewDidLoad {
    
    [super viewDidLoad];
    self.navigationItem.title=@"报价详情";
    self.tableView.tableHeaderView=self.quoteView;
    
}
-(UIView*)quoteView{

    if (!_quoteView) {
     
        _quoteView=[[UIView alloc]initWithFrame:CGRectMake(0, 0,WindowWidth , 170)];
        
        _topView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, WindowWidth, 50)];
        
        _middleView=[[UIView alloc]initWithFrame:CGRectMake(0, 51, WindowWidth, 120)];
        
        [_quoteView addSubview:_topView];
        [_quoteView addSubview:_middleView];
        
    
        _propertyLabel=[[UILabel alloc]init];
        
        _propertyLabel.font=[UIFont systemFontOfSize:14];
        
        _propertyLabel.text=@"活动内容:";
        
        [_propertyLabel sizeToFit];
        _propertyLabel.frame=CGRectMake(10, 10, _propertyLabel.frame.size.width, 15);
        
        _contentLabel=[[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_propertyLabel.frame)+10, 10, 120, 15)];
    
       
        _contentLabel.text=@"吃饭";
        _contentLabel.font=[UIFont systemFontOfSize:14];
        
        
        
        
        _statusLabel=[[UILabel alloc]initWithFrame:CGRectMake(WindowWidth-70, 10, 60, 15)];
        
        _statusLabel.text=@"待服务";
        
        _statusLabel.font=[UIFont systemFontOfSize:14];
         _statusLabel.textAlignment=NSTextAlignmentRight;
        _lineViewOne=[[UIView alloc]initWithFrame:CGRectMake(10, 49,WindowWidth-20, 1)];
        _lineViewOne.backgroundColor=[ImageUtil colorWithRgb:0xe6e6e6];
        
        _propertyLabel.centerY=_topView.centerY;
        _contentLabel.centerY=_topView.centerY;
        
        _statusLabel.centerY=_topView.centerY;
        

        _headImg=[[UIImageView alloc]initWithFrame:CGRectMake(10,20, 50, 50)];

        _headImg.clipsToBounds=YES;
        
        _headImg.layer.cornerRadius=25;
        
        _headImg.contentMode=UIViewContentModeScaleToFill;
        
        _headImg.image=[UIImage imageNamed:@"123"];
        
        
        _sexImg=[[UIImageView alloc]init];
        
        _sexImg.clipsToBounds=YES;
        
        _sexImg.frame=CGRectMake(CGRectGetMaxX(_headImg.frame)+10, 50, 10, 10);
        
        _sexImg.image=[UIImage imageNamed:@"nvsheng"];
        
        
        _nameLabel=[[UILabel alloc]init];
        
        
        _nameLabel.text=@"我想静一静   21";
        [_nameLabel sizeToFit];
        
        _nameLabel.frame=CGRectMake(CGRectGetMaxX(_sexImg.frame)+5, 50, _nameLabel.frame.size.width, 15);
        
        
        
        _nameLabel.font=[UIFont systemFontOfSize:12];
        
        _sexImg.centerY=_headImg.centerY;
        _nameLabel.centerY=_headImg.centerY;
        
        
        
        _priceLabel=[[UILabel alloc]init];
        
        _priceLabel.font=[UIFont systemFontOfSize:14];
        
        _priceLabel.text=@"对你报价：888888";
        
        _priceLabel.frame=CGRectMake(10, CGRectGetMaxY(_headImg.frame)+15, 160, 15);
        
        _lineViewTwo=[[UIView alloc]init];
        
        _lineViewTwo.backgroundColor=[ImageUtil colorWithRgb:0xe6e6e6];

        _lineViewTwo.frame=CGRectMake(10, self.middleView.frame.size.height-1, WindowWidth-20, 1);
        

        [self.topView addSubview:_propertyLabel];
        [self.topView addSubview:_contentLabel];
        [self.topView addSubview:_statusLabel];
        [self.topView addSubview:_lineViewOne];
        [self.middleView addSubview:_headImg];
        [self.middleView addSubview:_sexImg];
        [self.middleView addSubview:_nameLabel];
        [self.middleView addSubview:_priceLabel];
        [self.middleView addSubview:_lineViewTwo];
        
        
    
    }
    return _quoteView;

}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
